# Maintainer: David Runge <dvzrv@archlinux.org>

_name=django-classy-tags
pkgname=python-django-classy-tags
pkgver=4.0.0
pkgrel=2
pkgdesc="Class based template tags for django"
arch=(any)
url="https://github.com/django-cms/django-classy-tags"
license=(BSD)
depends=(python-django)
makedepends=(python-build python-installer python-setuptools python-wheel)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('9369e8e5fe603613aaf26b6f8de106e82c4def994806f8370640a5bc9b113c6629c2b5b2ced540234c243861acac620ec0cad28734bb1df12ca0f2e8e1b91b39')
b2sums=('9061950724b8f42194a23b1f0c5feccd45ba719922911b41448a5c510b9170cf557eb177ef80022ac3ef81ade962b7a088fbd07f3cf3389aa12d5b294d3bd102')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  export PYTHONPATH="$PWD/build/lib:$PYTHONPATH"
  python tests/settings.py
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
